package squarePackage;

import java.math.BigDecimal;


/**
 * A class illustrating how to manipulate digital clocks by
 * means of the methods offered by their class. 
 * 
 * @version 19/3/2011 11.08	
 * @author 	Pieter & An
 * 
 */

public class SquareUsage {
	
	/**
	 * Method illustrating how to apply methods to squares 
	 */
	public static void main(String args[]){
		
		//Square with temperature 150°C, Humidity 59.01%, Slippery, Borders : 1 2 & 3
		Square square1 = new Square(150,new BigDecimal("0.5901"));
		square1.setMaterial(false);
		square1.setSlippery();
		square1.setBorder(1,2,3);
		//Square with temperature 40°C, Humidity 89.90%, Not Slippery, Borders  : 2 3 4 
		Square square2 = new Square(40, new BigDecimal("0.8990"));
		square2.setMaterial(false);
		square2.setSlippery();
		square2.setBorder(2,3,4);
		
		//Merge square 1 with square 2 by border 2
		//Print state of Square 1 & 2 before and after merging to the standard output
		
	System.out.println("\b State of Square 1 and 2 before the merge \n");
	System.out.println("Square 1 parameters");
	System.out.println("-----------------------------------------------");
	System.out.println("Temperature :" + square1.getTemperature());
	System.out.println("Humidity :" + square1.getHumidity());
	System.out.println("Slippery :"+ square1.getSlippery());
	System.out.println("Borders :" + square1.getBorders() );
	System.out.println("Cold Damage :"+ square1.coldDamage());
	System.out.println("Heat Damage :"+ square1.heatDamage());
	System.out.println("Rust Damage :"+ square1.rustDamage());
	System.out.println("Inhabitability :"+ square1.getInhabitability() +"\n");

	
	System.out.println("Square 2 parameters");
	System.out.println("-----------------------------------------------");
	System.out.println("Temperature :" + square2.getTemperature());
	System.out.println("Humidity :" + square2.getHumidity());
	System.out.println("Slippery :"+ square2.getSlippery());
	System.out.println("Borders :" +square2.getBorders()  );
	System.out.println("Cold Damage :"+ square2.coldDamage());
	System.out.println("Heat Damage :"+ square2.heatDamage());
	System.out.println("Rust Damage :"+ square2.rustDamage());
	System.out.println("Inhabitability :"+ square2.getInhabitability() +"\n");
	
	square1.mergeWith(square2, 2);
	square1.setMaterial(false);
	square1.setSlippery();
	square2.setMaterial(false);
	square2.setSlippery();
	
	System.out.println("\b State of Square 1 and 2 after the merge \n");
	
	System.out.println("Square 1 parameters");
	System.out.println("-----------------------------------------------");
	System.out.println("Temperature :" + square1.getTemperature());
	System.out.println("Humidity :" + square1.getHumidity());
	System.out.println("Slippery :"+ square1.getSlippery());
	System.out.println("Borders :" +square1.getBorders() );
	System.out.println("Cold Damage :"+ square1.coldDamage());
	System.out.println("Heat Damage :"+ square1.heatDamage());
	System.out.println("Rust Damage :"+ square1.rustDamage());
	System.out.println("Inhabitability :"+ square1.getInhabitability() +"\n");

	
	System.out.println("Square 2 parameters");
	System.out.println("-----------------------------------------------");
	System.out.println("Temperature :" + square2.getTemperature());
	System.out.println("Humidity :" + square2.getHumidity());
	System.out.println("Slippery :"+ square2.getSlippery());
	System.out.println("Borders :" +square2.getBorders());
	System.out.println("Cold Damage :"+ square2.coldDamage());
	System.out.println("Heat Damage :"+ square2.heatDamage());
	System.out.println("Rust Damage :"+ square2.rustDamage());
	System.out.println("Inhabitability :"+ square1.getInhabitability());
}

}